import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_swiper/flutter_swiper.dart';

// 首页轮播图
class SwiperDiy extends StatelessWidget {
  final List<String> swiperDataList;

  SwiperDiy({Key key, this.swiperDataList}) : super(key:key);

  @override
  Widget build(BuildContext context) {
    return Container(
      height: ScreenUtil().setHeight(333),
      width: ScreenUtil().setWidth(750),
      child: Swiper(
        autoplay: true,
        pagination: SwiperPagination(),
        itemCount: swiperDataList.length,
        itemBuilder: (BuildContext context, int index){
          return Image.network(swiperDataList[index], fit: BoxFit.fill,);
        },
      )
    );
  }
}
